<template>
  <div class="tag-wrap">
    <div class="tag-text" @click="onClick">{{ text }}</div>
  </div>
</template>

<script>
  export default {
    name: "Tag",
    props: {
      text: {
        type : String,
        default : '前端开发',
      }
    },
    methods: {
      onClick() {  //标签点击事件
        this.$emit('onTagClick');
      }
    }
  };
</script>

<style lang="less" scoped>
  .tag-wrap {
    border-radius: 50px;
    background: #F7F7F9;
    color: #272E37;
    padding: 4px 15px;
    font-size: 14px;
    .tag-text {
      width: 100%;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
  }
</style>
